import inquirer from "inquirer";
import { docUtils } from "./utils";
//
import {QS} from "./questions";
//

const QD = QS.D;

const refreshDocs = async () => {
  const { isRefresh } = await inquirer.prompt([QD.isRefresh]);
  if(isRefresh){
    docUtils.refresh()
  }
}

const refreshDocSlide = async () => {
  const { isRefresh } = await inquirer.prompt([QD.isRefresh]);
  if(isRefresh){
    docUtils.refreshSlide()
  }
}

const refreshDocIndex = async () => {
  const { isRefresh } = await inquirer.prompt([QD.isRefresh]);
  if(isRefresh){
    docUtils.refreshIndex()
  }
}

const resetDocI18n = async () => {
  const { isReset } = await inquirer.prompt([QD.isReset]);
  if(isReset){
    docUtils.resetI18n()
  }
}

const clearDocs = async () => {
  const { isClear } = await inquirer.prompt([QD.isClear]);
  if(isClear){
    docUtils.clear()
  }
}

export default {
  refreshDocs,
  refreshDocSlide,
  refreshDocIndex,
  resetDocI18n,
  clearDocs
}